package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);


    /*int selectForCount(QueryObject qo);*/

    List<Employee> selectForList(EmployeeQueryObject qo);

    //插入关系
    void insertReation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    void deleteRelation(Long id);

    //查询用户名和密码
    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);


    //重置密码
    void resetPwdPage(@Param("newPassword") String newPassword, @Param("id") Long id);

    //修改密码
    void updatePwdPage(@Param("oldPassword") String oldPassword, @Param("newPassword") String newPassword, @Param("id") Long id);

    //批量删除,贴了注解sql用注解名称,否则array
    void batchDelete(@Param("ids") Long[] ids);

    //远程验证
    //验证用户名是否存在
    Employee selectByName(String name);

    //禁用/恢复账号功能
    void updateStatus(@Param("id") Long id, @Param("status") int status);

    List<Employee> selectByRoleSn(String[] sns);
}